package cn.iocoder.yudao.module.indicator.dao.IndicatorWarn;

import cn.iocoder.yudao.module.indicator.domain.dto.IndicatorWarnDto;
import cn.iocoder.yudao.module.indicator.domain.entity.IndicatorWarn;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Repository;

import java.util.Arrays;

/**
 * @author ZYW
 * @description: TODO
 * @date 2024-01-18 15:49
 */
@Mapper
@Repository
public interface IndicatorWarnMapper extends BaseMapperX<IndicatorWarn> {
    default PageResult<IndicatorWarn> selectPage(IndicatorWarnDto indicatorWarnDto) {
        return selectPage(indicatorWarnDto, new LambdaQueryWrapperX<IndicatorWarn>()
                .likeIfPresent(IndicatorWarn::getWarnName, indicatorWarnDto.getWarnName())
                .orderByDesc(Arrays.asList(IndicatorWarn::getCreateTime)));
    }

}
